package com.weir.order.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.weir.order.feign.UserServiceFeign;
import com.weir.order.service.OrderService;
import com.weir.user.entity.User;
@Service
public class OrderServiceImpl implements OrderService{

	@Autowired
	private UserServiceFeign userServiceFeign;
	
	@Override
	@HystrixCommand(fallbackMethod="getFallback")
	@RequestMapping("/get")
	public User get(Integer id) {
		User user = userServiceFeign.get(id);
		return user;
	}
	
	public User getFallback(Integer id) {
		return null;
	}
}
